import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HeroService } from '../../../../services/hero.service';
import { NzModalService } from 'ng-zorro-antd';

@Component({
  selector: 'app-feedbackinfo',
  templateUrl: './feedbackinfo.component.html',
  styleUrls: ['./feedbackinfo.component.css']
})
export class FeedbackinfoComponent implements OnInit {

  public data:Array<any>=[''];
  public userinfo:Array<any>=[''];
  constructor(private heroService: HeroService,
              private route: ActivatedRoute,
              private modalService: NzModalService) { }

  ngOnInit() {
    this.getFeedbackinfo();
  }

  //获取工单详情数据
  getFeedbackinfo(){
    const id= this.route.snapshot.params["id"]; 
    let url=host+"/main/merchantFeedback/view?id="+id;
    this.heroService.get(url).then(result=>{
      if(result.code==0){
        this.data[0]=result.data.bean;
        this.userinfo[0]=result.data.user;
      }else{
        this.modalService.error({
          nzTitle: '提示',
          nzContent: result.msg
        });
      }
    })
  }

}
